
function getProductOnAccurateSearch() {
    let url = "/product/selectProductOnAccurateSearch";
    let params={
        keyWords:"%"+$("#nameSearch").val()+"%",
        minPrice:$("#minMoney").val(),
        maxPrice:$("#maxMoney").val(),
        star:$("#starSearch").val()
    }
    console.log(params);
    httpPost(url,params,function (data) {
        renderingAccurateSearchProduct(data);
    })
}

function renderingAccurateSearchProduct(productList) {
    let templateProductHtml = $("#template_product_accurateSearch").html();
    let productListHtml = "";
    let tempProductHtml;
    //遍历商品列表
    $.each(productList,function (index, product) {
        //后台数据填充到模板
        tempProductHtml=templateProductHtml.replace(/{name}/g,product.name)
            .replace(/{info}/g,product.info)
            .replace(/{id}/g,product.productId)
            .replace(/{picture}/g,product.picture)
        productListHtml+=tempProductHtml;
    });
    console.log(productListHtml);
    $("#div_product_accurateSearch").html(productListHtml);
}